package com.company.wushuo.justfortest.reactive;

/**
 * 将Observer包装成Subscriber
 * Created by wushuo on 2021/4/4.
 */

public class ObserverSubscriber<T> extends Subscriber<T> {

    Observer<T> observer;

    ObserverSubscriber(Observer<T> value) {
        observer = value;
    }

    @Override
    public void onNext(T value) {
        observer.onNext(value);
    }

    @Override
    public void onError(Throwable throwable) {
        observer.onError(throwable);
    }

    @Override
    public void onComplete() {
        observer.onComplete();
    }
}
